// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "ProceduralMeshComponent.h"
#include "Materials/Material.h"
#include "Materials/MaterialInstanceDynamic.h"
#include "Utility.h"
#include "GmbActor.generated.h"

UCLASS()
class METEOR5_API AGmbActor : public AActor
{
	GENERATED_BODY()
	
public:	
	// Sets default values for this actor's properties
	AGmbActor();
	TArray<FVector> Verties;
	TArray<int32> Triangles;

	TArray<FVector> Normals;
	TArray<FVector2D> UV;
	TArray<FColor> VertexColors;
	TArray<FProcMeshTangent> Tangents;

	UMaterial* Material;
	TArray<UMaterialInstanceDynamic*> MaterialInstance;
	UPROPERTY(EditAnywhere)
	UProceduralMeshComponent* Mesh;
	TArray<int32> MaterialIndex;
	void LoadMesh(TArray<MeshVert*> v, TArray<MeshFace*> t, TArray<FString> texs, TArray<ShaderUnit*> s);
	void ClearMeshData();
protected:
	// Called when the game starts or when spawned
	virtual void BeginPlay() override;

public:	
	// Called every frame
	virtual void Tick(float DeltaTime) override;

};
